<template>
	<view class="head" :style="{ paddingTop: topheight }">
		<view class="head-np">
			<view class="back" @click="back()">
				<image src="../static/img/chat-09.png"></image>
			</view>
			<view class="title">{{ titleName }}</view>
			<view @click="rightClick()">
				<slot name="rightIcon"></slot>
			</view>
		</view>
	</view>

</template>

<script>
	export default {
		// props: ['titleName','navBarHeight'],
		props: {
			titleName: {
				type: String,
			},
			topheight: {
				type: String
			},
			backGround: {
				type: String,
				default: '#fff'
			}
		},
		data() {
			return {}
		},
		methods: {
			back() {
				uni.navigateBack()
			},
			rightClick() {
				this.$emit('rightClick')
			}
		},
	}
</script>

<style lang='scss'>
	.head {
		position: fixed;
		top: 0;
		height: 48px;
		z-index: 1;
		width: 100%;
		background: #fff;

		.head-np {
			display: flex;
			justify-content: space-between;
			align-items: center;
			width: 100%;
			height: 100%;
			padding: 0 30rpx;
			box-sizing: border-box;

			.back {
				image {
					width: 20rpx;
					height: 37rpx;
				}
			}

			.title {
				font-size: 36rpx;
				font-weight: bold;
				color: #000;
			}
		}
	}
</style>